<%--
  Created by IntelliJ IDEA.
  User: 王坤华
  Date: 2021/11/22
  Time: 9:36
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>Title</title>
    <script src="js/jquery-1.9.1.min.js"></script>
    <script src="js/fileupload.js"></script>
    <link rel="stylesheet" href="css/img.css">
    <link rel="stylesheet" href="css.css">
</head>
<body>
<h1>添加页面</h1>
<form>
    下单时间:<input type="text" name="xiadanshijian">
    订单编号:<input type="text" name="dingdanbianhao"><br>
    制单人:<input type="text" name="zhidanren">
    仓库:<select name="cangku">
    <option value="">请选择</option>
    <option value="A仓库">A仓库</option>
    <option value="B仓库">B仓库</option>
    <option value="C仓库">C仓库</option>
</select><br>
    库位:<input type="text" name="kuwei">
    订货人:<input type="text" name="dinghuoren"><br>
    总金额:<input type="text" name="zongjine" readonly>
    折让金额:<input type="text" name="zherangjine"><br>
    交货方式:<select name="jiaohuofangshi">
    <option value="">请选择</option>
    <option value="货到付款">货到付款</option>
    <option value="送货上门">送货上门</option>
    <option value="提前付款">提前付款</option>
</select>
    物流单号:<input type="text" name="wuliudanhao"><br>
    附件成本:<input type="text" name="fujianchengben">
    交货地点:<input type="text" name="jiaohuodidian"><br>
    <input type="button" value="添加" onclick="add()">
</form>
</body>
<script>
    function add() {
        let formData = new FormData($("form")[0]);
        $.ajax({
            url:"add.do",
            data:formData,
            type:"post",
            dataType:"json",
            processData: false,
            contentType:false,
            success:function (obj) {
                if (obj>0){
                    alert("添加成功")
                    location="list.do"
                }
            }
        })
    }
</script>
</html>
